package com.company.book_store.web.servlet;

import com.company.book_store.pojo.User;
import com.company.book_store.service.Iuserservice;
import com.company.book_store.service.UserserviceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/adminUpdateUser")
public class adminUpdataUser extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String account = req.getParameter("account");
        String username = req.getParameter("username");
//        String passowrd = req.getParameter("password");
        String email = req.getParameter("email");
        String phone = req.getParameter("phone");
        User user = new User(account,null,email,phone,username);

        Iuserservice iuserservice = new UserserviceImpl();
        iuserservice.updateuser(user);

    }
}
